package com.phone.client.config;


import com.seventh.common.utils.RsaUtils;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import javax.annotation.PostConstruct;
import java.security.PrivateKey;
import java.security.PublicKey;

/**
 * @program: clms-seventh
 * @description: 公钥私钥配置类
 * @author: 张静
 * @create: 2021-07-17 20:32
 **/
@Data
@ConfigurationProperties(prefix = "zj.key")
public class RsaKeyProperties {
    private String pubKeyPath;
    private String prikeyPath;
    private PublicKey publicKey;
    private PrivateKey privateKey;
    @PostConstruct
    public void loadkey()throws Exception{
        publicKey= RsaUtils.getPublicKey(pubKeyPath);
        privateKey=RsaUtils.getPrivateKey(prikeyPath);
    }
}
